package com.hnevc.io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ImageCopyDemo {

	public static void main(String[] args) throws IOException {
		InputStream in = new FileInputStream("I:\\DD2018S\\1.jpg");
		OutputStream out = new FileOutputStream("I:\\DD2018S\\2.jpg");

		byte[] bf = new byte[4];
		int len = 0;

		while (len != -1) {
			len = in.read(bf);
			if (len != -1) {
				out.write(bf, 0, len);
			}
		}
		in.close();
		out.close();

	}

}
